﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;

public class TestFaceMatch : MonoBehaviour {
    private void Awake()
    {
        System.Net.ServicePointManager.ServerCertificateValidationCallback +=
            delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
            System.Security.Cryptography.X509Certificates.X509Chain chain,
            System.Net.Security.SslPolicyErrors sslPolicyErrors)
            {
                return true;
            };
       
    }
    // Use this for initialization
    void Start () {
        string path = Application.streamingAssetsPath + "/";
        Baidu.Aip.Face.Face client = new Baidu.Aip.Face.Face("a7EY1wb5xIZ6csrH7xngGsiO", "91gcDeLgs4C7tG1dKOCPcH7dKUbFqqPi");
        byte[] image1 = File.ReadAllBytes(path+"1.jpg");
        byte[] image2 = File.ReadAllBytes(path+"shi3.jpg");
        byte[][] images = new byte[][] { image1, image2 };
        Debug.Log( client.FaceMatch(images).ToString());
    }
	
	// Update is called once per frame
	void Update () {
		
	}
}
